# -*- coding=utf-8 -*-

from __future__ import unicode_literals
from django.db import models


class Article(models.Model):
    status_choices = (
        ('0', '草稿'),
        ('1', '博客'),
    )
    id = models.IntegerField(name = 'id', primary_key = True, verbose_name = '文章 id')
    url = models.CharField(max_length = 20, unique = True, name = 'url', verbose_name = '文章 url 地址')
    status = models.CharField(default = '0', max_length = 1, choices = status_choices, verbose_name = '文章状态')
    title = models.CharField(max_length = 100, name = 'title', verbose_name = '文章标题')
    abstract = models.CharField(max_length = 400, verbose_name = '文章摘要', name = 'abstract')
    content = models.TextField(name = 'content', verbose_name = '文章内容')
    create_time = models.DateTimeField(name = 'create_time', auto_now = False)

    class Meta:
        db_table = 'blog_article'
        ordering = ['-create_time']
